package com.gmail.bogatyr.alexander.server.dao;

import org.hibernate.Session;
import org.springframework.data.jpa.repository.support.SimpleJpaRepository;

import javax.persistence.EntityManager;

public class BaseDao<T> extends SimpleJpaRepository<T, Long> {

    private final Session session;

    public BaseDao(Class<T> domainClass, EntityManager em) {
        super(domainClass, em);
        this.session = em.unwrap(Session.class);
    }

    protected Session getSession() {
        return session;
    }
}
